package com.clement.service;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;

/**
 * Created by Clement on 2017/5/8.
 */
@Service
public class HelloMessageService implements MessageService {

    @Override
    @PreAuthorize( "authenticated")
    public String getMessage() {
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();

        return "Hello" + authentication;
    }
}
